*Reanalysis of Tomz 2007
clear
use "/Users/Allan/Dropbox/DataSets/Tomz Audience Costs/tess_tomz_main_client.dta"

**Distribution of Results**
**disapprove variable
gen dis=.
replace dis=1 if e1_q5a==2 
replace dis=0 if e1_q5a==1 | e1_q5a==3


*Southern according to this criterion: Alabama, Arizona, Arkansas, Florida, Georgia, Kentucky, Louisiana, Mississippi, New Mexico, North Carolina, Oklahoma, South Carolina, Tennessee, Texas, Virginia, and West Virginia. 

*use labelbook to see what numbers correspond with what states

gen South=0 
*since no missing values
labelbook ppstaten
replace South=1 if ppstaten==74| ppstaten==71 | ppstaten==71 | ppstaten==64 | ppstaten==63 | ppstaten==59 | pps	taten==58 | ppstaten==57 | ppstaten==56 | ppstaten==62 | ppstaten==61 | ppstaten==55 | ppstaten==86 | ppstaten==54 | ppstaten==85 | ppstaten==73

tab dis e1_cond   if South==0 & ppgender==1, co
tab dis e1_cond   if South==1 & ppgender==1, co

**2012-05-18: best to subset on white men. 
tab dis e1_cond   if South==0 & ppgender==1 & ppeth==1, co
tab dis e1_cond   if South==1 & ppgender==1 & ppeth==1, co

ttest dis if (e1_cond==1) & ppgender==1 & ppeth==1, by(South) 

ttest dis if (e1_cond==2) & ppgender==1 & ppeth==1, by(South) 


*Looking at this in terms of domestic audience costs, which is the disapproval after threatening, minus the disapproval under the control state. Interpret the threatSouth coefficient. *Result: same as just with ttest under threat condition. 
gen threat=0
replace threat=1 if e1_cond==2
gen threatSouth=threat*South

logit dis threat South threatSouth if ppgender==1 & ppeth==1 & e1_cond<3
reg dis threat South threatSouth if ppgender==1 & ppeth==1 & e1_cond<3

ttest dis if (e1_cond==2) & ppgender==1, by(South) 
ttest dis if (e1_cond==2) & ppeth==1, by(South) 
ttest dis if (e1_cond==2), by(South) 

*for more analysis, see "10.10.22 analysis of tomz 2007.do"

outsheet using "/Users/Allan/Dropbox/!!Papers/1Reputation/Honor-Culture-War/2012-05/Replication/Tomz/130108_tomz.csv", comma replace